<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type='text/javascript' src='../vue.js'></script>
    <style>
        *{
            gap: 10px;
            margin: 10px;
        }
        #ak{
            height: 50px;
            width: 200px;
            background-color: skyblue;
        }
        #list{
            width: 400px;
            height: 400px;
            background-color: bisque;
            overflow: auto;
        }
        li{
            width: 200px;
            height: 200px;
            background-color: aqua;
        }
        #list2{
            width: 400px;
            height: 400px;
            background-color: red;
            overflow: auto;
        }
    </style>
</head>
<body>
    <div class="root">
        {{key}}
    </div>
    <div id="root">
        <h1>事件修饰符{{key}}</h1>
        <a href="https://www.bilibili.com" @click.once="aClick">点我去bilibli</a>
        <button @click.once="aClick">点我</button>
        <hr>
        <!-- 阻止事件冒泡 -->
        <div id="ak" @click.self="aClick">
            <button @click="aClick">点我</button>
        </div>
        <!-- 阻止事件冒泡 -->
        <div id="ak" @click="aClick">
            <button @click.stop="aClick">点我</button>
        </div>
        
        <div id="ak" @click="aClick">
            <button @click="aClick">点我</button>
        </div>

        <ul id="list" @scroll="scroll">
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>

        <ul id="list2" @wheel="scroll">
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>

    </div>

    <script type='text/javascript'>

    new Vue({ 
        el: '.root',
        data: {
            key:"value-----"
        }
    })

    new Vue({ 
        el: '#root',
        data: {
            key:"value"
        },
        methods: {
            aClick(){
                alert("hello")
            },
            scroll: function(){
                console.log("aaaa")
            }
        }

    })
   
   </script>
   

</body>
</html>